UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TwgBf3hej8NcAMI+d3GxFCCXhjx4sVCs7o20UG5LAls=' 
WHERE 
  key_id = '43b2b00ef226f9e15a2c77a084da54eb0806aa5015ec412bdd2d151f9e954657' 
  AND (
    token = 'TwgBf3hej8NcAMI+d3GxFCCXhjx4sVCs7o20UG5LAls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034