UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BhGBUQshBXQPuMtLMfGMQfm+t5TqiTqUTYlXxSF6clI='
WHERE
key_id = '86707ca93a6fd1c2dbe383f222cac786d27f12e05b7e3e5a088eb611c5808667'
AND (
token = 'BhGBUQshBXQPuMtLMfGMQfm+t5TqiTqUTYlXxSF6clI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)