UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vmZGxNqFDhQIZKYlY1dMTz5xnvDcE0ceTZx5pfr/jQ0='
WHERE
key_id = '1ad9aac0a880679790aa1577b88cc13ecf62a00a7c17b81a555e6428cf68b498'
AND (
token = 'vmZGxNqFDhQIZKYlY1dMTz5xnvDcE0ceTZx5pfr/jQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)