UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/FQOjxqkmlaVx9ynZykkJdpKVEGAnzKintlJapEMEDs=' 
WHERE 
  key_id = 'a8790dc47518ac0f41f5b3b3dcaf9feba1c39626141827636738378fd32a7385' 
  AND (
    token = '/FQOjxqkmlaVx9ynZykkJdpKVEGAnzKintlJapEMEDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025