UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eyuH8IaEzTrIN+/8GzCPBw2SPsK2NkExk+hdypysgQg=' 
WHERE 
  key_id = 'a30aa6c2a069c49c3d67eb180b07d020969cd9b31ee65f42384df9cc118bcc67' 
  AND (
    token = 'eyuH8IaEzTrIN+/8GzCPBw2SPsK2NkExk+hdypysgQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019