UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '79ZfAQK8jgLuYSTvsZsoq3OMJF4Pwp8sVjKyFR8tUEU='
WHERE
key_id = 'c61f2e4db41adb6cb01c02508418667e80241868e2ccb7fa5f6b2672b41d29c2'
AND (
token = '79ZfAQK8jgLuYSTvsZsoq3OMJF4Pwp8sVjKyFR8tUEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)