UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zNLTTBR4UCOvYGC71Wf0kG/gpRf6eIlXw+I5uEHIZGk=' 
WHERE 
  key_id = '69f064a71db10fed25ff8c624c456660c8bb50844dbf3270ba96c3b090688683' 
  AND (
    token = 'zNLTTBR4UCOvYGC71Wf0kG/gpRf6eIlXw+I5uEHIZGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029