UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DmjM62UZDeJSy7FcqYreJOOJiUjVQ10AtJFlAzSJUM='
WHERE
key_id = '8437ac181710ff335bf871ecfe37acf4c769d615c052bd24852eee534e088353'
AND (
token = '9DmjM62UZDeJSy7FcqYreJOOJiUjVQ10AtJFlAzSJUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)