UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rQZcoBA4khbwM6SZt1/lpx0liP7c+OR06dOHnfQpPE0='
WHERE
key_id = '6d7cf0c1f14aeee5a88e4d83fcc6006ecdb633d37690ec52bb788e5c32b4bf1e'
AND (
token = 'rQZcoBA4khbwM6SZt1/lpx0liP7c+OR06dOHnfQpPE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)