UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8QvyHkdESreB+U1UnZzN7KBy/Df7vSBRUGxBWRLhHLA='
WHERE
key_id = 'dbf9810275e836d81f457e0f76ac082890e74183730ec879475fd26a5e1f68d1'
AND (
token = '8QvyHkdESreB+U1UnZzN7KBy/Df7vSBRUGxBWRLhHLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)