UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yzGY3Lme2x3x+DbVfjJRHpnUg5RIaCVO98gGU0Q9lyc=' 
WHERE 
  key_id = 'ab0328b897f663f6a0c8a57b1370f9c6ff128005b126e0e431a68b0620555e44' 
  AND (
    token = 'yzGY3Lme2x3x+DbVfjJRHpnUg5RIaCVO98gGU0Q9lyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050