UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cjiYgV/C9uXgUiFsqhOgIr4TF6EYYQhoIpLqSPRPQUc='
WHERE
key_id = '204538f74c805c089fb4665331458ffd9968834bbef26edf3fcaea45e611638a'
AND (
token = 'cjiYgV/C9uXgUiFsqhOgIr4TF6EYYQhoIpLqSPRPQUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)