UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EXjsvru9cVcEGltOaYwNX7L9IU+Mntr6pXrzvEcibVc='
WHERE
key_id = 'f73629f023f3d18eb45dc4c70f9750f960a525f11ccae075b3b541850dae1b24'
AND (
token = 'EXjsvru9cVcEGltOaYwNX7L9IU+Mntr6pXrzvEcibVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)