UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9VgrmSXsf/5Io++kcKSXZ7uRJ/6jv4oZB4avZKdiMc8='
WHERE
key_id = '1b9e6cc9219bd3a9bf41693b9a7264f7403b8a18b04ee5556ff14cb0129602bc'
AND (
token = '9VgrmSXsf/5Io++kcKSXZ7uRJ/6jv4oZB4avZKdiMc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)