UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dFou0Ygg4vce+eEYy88N1m8yUWzTRqlIvqm3bDzFj4Y='
WHERE
key_id = '089788f3bdd975a06ad5796f75b418747190fea1b7eae69acf754a80bec5822a'
AND (
token = 'dFou0Ygg4vce+eEYy88N1m8yUWzTRqlIvqm3bDzFj4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)