UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kAOqLfW2ZAX4x++HqwaSxEZ39Bfcxa4oZBVZBRhyiQU=' 
WHERE 
  key_id = '61a56a148728b692f36117cd86af2b95a355e275a65f5c698c310639e1dac965' 
  AND (
    token = 'kAOqLfW2ZAX4x++HqwaSxEZ39Bfcxa4oZBVZBRhyiQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022