UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZuKGQApaWxYYFpcfRD3gMBMvbU6z4cBoLD8beFaleE='
WHERE
key_id = 'c96d64e32cea0367d3ff21a6781a71562e5d915f74a5b611552a5d9d41af7741'
AND (
token = 'uZuKGQApaWxYYFpcfRD3gMBMvbU6z4cBoLD8beFaleE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)