UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5keVieNNrSeiaKvp+x2xKIPcvTluf1bSLQxmciNkBs='
WHERE
key_id = 'cd21e7e1114774cbeb1cb6c8365070b30fcd10e69017ec07b0db5dc2925dc614'
AND (
token = 'l5keVieNNrSeiaKvp+x2xKIPcvTluf1bSLQxmciNkBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)