UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gGZI381MTKmsqPNeSdzQEMoQe1KpA53q8hhuXP2YT/U=' 
WHERE 
  key_id = '9ef097a69200dd9e874b4c28e45096beed5a2ed0a3ffe48d1ab4fb38924c87c5' 
  AND (
    token = 'gGZI381MTKmsqPNeSdzQEMoQe1KpA53q8hhuXP2YT/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028