UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ps0gOoMUem/u+J0hPBzs9mNl9np9qDJ8PsD5KnPkzZQ=' 
WHERE 
  key_id = '53dcb2f2b1302faf88826332684622793c3b0d0d630c139c0bac1bb8ce956510' 
  AND (
    token = 'Ps0gOoMUem/u+J0hPBzs9mNl9np9qDJ8PsD5KnPkzZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024