UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HQwW/V5ZXWgQHml4zA4yUkHVNVOcd1A5J0vmIIAssL4='
WHERE
key_id = '8c26175d5f67cc5ca43db301ad139889adb4f3c8116550fc34747cceff78548a'
AND (
token = 'HQwW/V5ZXWgQHml4zA4yUkHVNVOcd1A5J0vmIIAssL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)