UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HCH8TaZ6gAhq/Tx+TwCkyc9mclf/rFvg75ZyVU2D4dQ=' 
WHERE 
  key_id = 'c7a91714bb2c3652069ed354bc26a9010b7e459b1a2912d2a9813798b2a61f8a' 
  AND (
    token = 'HCH8TaZ6gAhq/Tx+TwCkyc9mclf/rFvg75ZyVU2D4dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027