UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HL2eWuoe4TQckgE6Xut6S6yhxlXqL02Kwli2KntWZJk='
WHERE
key_id = '44628af14b019312328841f0592a8b7c83c0e1b6e349b597ed60a41370925631'
AND (
token = 'HL2eWuoe4TQckgE6Xut6S6yhxlXqL02Kwli2KntWZJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)