UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HAXS4v1vJBXByf37+sg0qcPBOAe652/U7sYP1ahhPcA='
WHERE
key_id = '9db6d1b9694844a0774bea7d81595e1e77e5fddec8e297991fe6bf5687a9a7e5'
AND (
token = 'HAXS4v1vJBXByf37+sg0qcPBOAe652/U7sYP1ahhPcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)