UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IdGo0fgOt7BPDBWCmFPJXLDVJr/ouJ/cg8dQubyiXEc='
WHERE
key_id = 'f6f8a68ce9ce951ed320fcbf2166cdf028ca7242aebe27f0b64d91009dd9c1b1'
AND (
token = 'IdGo0fgOt7BPDBWCmFPJXLDVJr/ouJ/cg8dQubyiXEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)