UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QcoSRBpUGNwJ2huWj8r5b0WI738Mu6oZy/2fIlEqmAE=' 
WHERE 
  key_id = '3979c681d1e64335f4864fe1b16742daae63d2e41d189b8eff54cf53d07b1a87' 
  AND (
    token = 'QcoSRBpUGNwJ2huWj8r5b0WI738Mu6oZy/2fIlEqmAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051