UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7HTBXFMSr2a5N4Nq4sKSkAbw/iP9DP8lvg0lftzdwxo=' 
WHERE 
  key_id = 'f8742bbf5a38e9d481f6c78cf7d5795cb8e85008ea34b5c037606b7d06d0e6d7' 
  AND (
    token = '7HTBXFMSr2a5N4Nq4sKSkAbw/iP9DP8lvg0lftzdwxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028