UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpv+Yew9jajEnodZEgQUWslZlv4f7VhHUqEI6iFv8bw='
WHERE
key_id = '0cad9dc7afe5a558e8498397868a0725141c511d4d81adf7d31ff885a7f28a6d'
AND (
token = 'xpv+Yew9jajEnodZEgQUWslZlv4f7VhHUqEI6iFv8bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)