UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'svhoXh0LiBvRCDxPO4nK0f7FWgTlRb4TkY8vIPliA44=' 
WHERE 
  key_id = 'db8a70a7b42fcd6b17c3736f90ae31f604066ef77772819bd7bd2caa302c350f' 
  AND (
    token = 'svhoXh0LiBvRCDxPO4nK0f7FWgTlRb4TkY8vIPliA44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017