UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ylAE2ydMDsBH+JuxzfXkqhx0o09btcVQ6Vhzl/g/eGY=' 
WHERE 
  key_id = '2cf7e997dfb566e98e0c84da439fda62b93b149c612766994ce3f0e0d20a7ca9' 
  AND (
    token = 'ylAE2ydMDsBH+JuxzfXkqhx0o09btcVQ6Vhzl/g/eGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026