UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fMjrEk5IpfMohPvkcB9+ZHREqnSPW5T7jJh0/8Davg8='
WHERE
key_id = 'a4f4574e2db05e23f21bc2fa4e27d2e5ea0524f413af898c4f35e7f64feb1795'
AND (
token = 'fMjrEk5IpfMohPvkcB9+ZHREqnSPW5T7jJh0/8Davg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)