UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8pI3qMFn3LV0dxJkQhcJsmoTZJC46JUz6KKs086YoK4='
WHERE
key_id = '841a962acb643ef4cbfdcafca3f7dfcae8b83361dbae8692a029cc701a94dc8e'
AND (
token = '8pI3qMFn3LV0dxJkQhcJsmoTZJC46JUz6KKs086YoK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)