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

Query time 0.00019