UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'txkjg3mfUzAJ1NDTD+M1Jtr20kqMHilmp+MacYYoLv0='
WHERE
key_id = '8113ee3cd32b51ad19e29c3949353635a79f92b555537b953362771ae1082a79'
AND (
token = 'txkjg3mfUzAJ1NDTD+M1Jtr20kqMHilmp+MacYYoLv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)