UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FDV+qjG0UGHXXfJO7DMH1921Ue2AkO9VWgbpdbKesCs=' 
WHERE 
  key_id = '95cb027763319867c62fa8719936481bfb5aecad7b64da0820d6810e2f90970f' 
  AND (
    token = 'FDV+qjG0UGHXXfJO7DMH1921Ue2AkO9VWgbpdbKesCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039