UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdo/hu2Mt1HdzBSGbUypQWQly759s7vgpxAVyRsPAEw='
WHERE
key_id = '212e9d9b3a942ac876de4b7e96b294317916549f9e70b4eb793319523e478a8f'
AND (
token = 'qdo/hu2Mt1HdzBSGbUypQWQly759s7vgpxAVyRsPAEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)