UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pvfojGlZWQqsPKhXyHLsHCbPGVsDC8QQkK4tWZSWbJI=' 
WHERE 
  key_id = 'bc85d55f39de16b866d027c3fe792c3232b9a3bcc1f41c6365e30f9ed729fa44' 
  AND (
    token = 'pvfojGlZWQqsPKhXyHLsHCbPGVsDC8QQkK4tWZSWbJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026