UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vmzF3+ZqUvC6zPHSQpjjrezzRaWqtyyDjsQhAmuppgY='
WHERE
key_id = '54ee1c5c51c5bc931433e88cdddfafb76a00188d81d84294d40608f8e812f8b3'
AND (
token = 'vmzF3+ZqUvC6zPHSQpjjrezzRaWqtyyDjsQhAmuppgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)