UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qJDaLaWC2bNZYyWkFyeOpvmsQpfnZXplbPDOcOK3qxc='
WHERE
key_id = '0930cbeb912a9d0304847b6d6927952324b8b1deacc24adb69f5a37241bfc845'
AND (
token = 'qJDaLaWC2bNZYyWkFyeOpvmsQpfnZXplbPDOcOK3qxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)