UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'btwzpFkBs2igR4/9Z/tYT3mOFQZzaL4tlUJnsSbBP8Y=' 
WHERE 
  key_id = 'c992ceb4558624959f14e8e5cd39653b1b97410702419c46a43ec70613cf9b15' 
  AND (
    token = 'btwzpFkBs2igR4/9Z/tYT3mOFQZzaL4tlUJnsSbBP8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047