UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '369tpPl7mWCEyErmKB35am37qPsLxAzNPV4h26V3TVk='
WHERE
key_id = 'f34c7b4909756d6587b1ada1584286e20c8b21b39e6bb381ec477b89735077a1'
AND (
token = '369tpPl7mWCEyErmKB35am37qPsLxAzNPV4h26V3TVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)