UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LXqtY5PUQVhkl4B+Lxldv0k62icaLaCFO4ObZKaO3PA=' 
WHERE 
  key_id = '1feca471562055a9b9122192d025f35c7c3ade2211ca63473a979200f1b21467' 
  AND (
    token = 'LXqtY5PUQVhkl4B+Lxldv0k62icaLaCFO4ObZKaO3PA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036