UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F+KNFjo6oX/M5x6Uo8lRIbFr+crYMnl2Vywrjn2se1E=' 
WHERE 
  key_id = '1069fe4451a8f1120ae95e9f0858a1a8ecf459ec894ac0b875cbd1de4aaafe26' 
  AND (
    token = 'F+KNFjo6oX/M5x6Uo8lRIbFr+crYMnl2Vywrjn2se1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017