UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yuFwqbjb/xAuNpSYbOm7/eeD3qd+IjcI78tiVkuWSmM='
WHERE
key_id = '6946c4bafc863bf1a2cbe067739bd0e7d8d2aa626d4db36f93b2639a7da544a8'
AND (
token = 'yuFwqbjb/xAuNpSYbOm7/eeD3qd+IjcI78tiVkuWSmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)