UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F5AYdHE6BrK0DQuiynNG28iFY3YxlkpH5Fpo/IHP8No=' 
WHERE 
  key_id = '86f0966be760dfde68970c409abba2309032634f81c0f79f58d0b48fe49678d3' 
  AND (
    token = 'F5AYdHE6BrK0DQuiynNG28iFY3YxlkpH5Fpo/IHP8No=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021