UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LI0sNBGS9MNGQdHJKpx+Cs4Igp25kzUl7Ik6Huv6HGE=' 
WHERE 
  key_id = '9f86d32795523a2c2691b6b61da968ed56f23bfdf1a920dd299d7f276d86ea5b' 
  AND (
    token = 'LI0sNBGS9MNGQdHJKpx+Cs4Igp25kzUl7Ik6Huv6HGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014