UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/OxvDf7hzhxJKVsLjsXXaHODhEDLUayHAeZRR3IIT5g='
WHERE
key_id = '61ff44da0de6cb48285d7fa22b537d9862a9147a0316d034e272893b5ce0c72b'
AND (
token = '/OxvDf7hzhxJKVsLjsXXaHODhEDLUayHAeZRR3IIT5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)