UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qiT61yNAnY0WYMbc6hH5RJUvvGrjiU1ZdXgSyf7XEmA='
WHERE
key_id = '934d6765fd1f44ec4c9158de8ee28570c3c1a7eae7e5d3cbb31dde66767cc09d'
AND (
token = 'qiT61yNAnY0WYMbc6hH5RJUvvGrjiU1ZdXgSyf7XEmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)