UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pbMS2pumCktfrGp1aejTYI0fpv3j6ZhQJH5k3H1OEAo='
WHERE
key_id = '0e9da59a09f737e1f4d7cd6d89a9227c0a6cd9dcaffc55919858f8204ed1cb12'
AND (
token = 'pbMS2pumCktfrGp1aejTYI0fpv3j6ZhQJH5k3H1OEAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)