UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7/2bqzIHNNtW6iKWWS2HZdM67HT6CVPuCFZG+044T7g=' 
WHERE 
  key_id = 'cd3670eeb7596cb3678c785ade28264efa9413b78ac4eb75196744c7b5abe889' 
  AND (
    token = '7/2bqzIHNNtW6iKWWS2HZdM67HT6CVPuCFZG+044T7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060