UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0E9YyFrOI6BWkGszWsG6GBaMDE+7k4KaRKZ7K3JauQo='
WHERE
key_id = '8a214f108a731e282b3cd7f84b462a594c4ba547c8cfde1e21e60e58c7beb947'
AND (
token = '0E9YyFrOI6BWkGszWsG6GBaMDE+7k4KaRKZ7K3JauQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)